package com.huluobo.a2107jetpackkotlindemo.paging

import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.create
import retrofit2.http.GET
import retrofit2.http.Query

/**
 *  Created by LC on 2023/11/28.
 */
interface ApiService {
    @GET("/goods/info")
    suspend fun queryData2(
        @Query("category_id") category_id: Int,
        @Query("currentPage") currentPage: Int,
        @Query("pageSize") pageSize: Int
    ): GoodsBeanResult

    companion object {
        private const val BASE_URL = "http://10.161.9.80:7012"
        fun create(): ApiService {
            return Retrofit.Builder().baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build().create(ApiService::class.java)
        }
    }
}